package com.jinzhi.jzapi.training.controller;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.jinzhi.common.annotation.Log;
import com.jinzhi.common.base.BaseController;
import com.jinzhi.common.type.ApiEnumError;
import com.jinzhi.common.utils.ApiResult;
import com.jinzhi.common.utils.StringUtil;
import com.jinzhi.jzapi.certificate.pojo.AuntUserVO;
import com.jinzhi.jzapi.training.pojo.ApplicationRecordVo;
import com.jinzhi.jzapi.training.pojo.RecruitmentNewsVo;
import com.jinzhi.jzweb.domain.*;
import com.jinzhi.jzweb.service.*;
import com.jinzhi.jzweb.utils.IdCardUtil;
import com.jinzhi.sys.domain.UserDO;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;

import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import static com.jinzhi.api.util.TokenTag.TOKEN_TAG;

@Slf4j
@RestController
@RequestMapping("/jzApi/recruitment")
public class ApiRecruitmentController extends BaseController {

    @Autowired
    private OrganizationNewsService organizationNewsService;
    @Autowired
    private ResumesService resumesService;
    @Autowired
    private RecruitmentNewsService recruitmentNewsService;
    @Autowired
    private ApplicationRecordService applicationRecordService;
    @Autowired
    private BookOrderService bookOrderService;

    /**
     * 给阿姨端接口：查询简历列表接口
     * @return
     */
    @ApiOperation(value = "查询简历列表接口")
    @RequestMapping(value = "/api/getRecruitList", method = RequestMethod.GET)
    public ApiResult<List<AuntUserVO>> getRecruitList()  {
        List<AuntUserVO> list=new ArrayList<>();
        try {
            EntityWrapper<ResumesDO> resumesDOEntityWrapper = new EntityWrapper<>();
            List<ResumesDO> resumesDOS = resumesService.selectList(resumesDOEntityWrapper);
            if (!resumesDOS.isEmpty()){
                Pattern pattern = Pattern.compile("^[1][3-9]\\d{9}$"); // 正则表达式，匹配中国的手机号码
                resumesDOS.forEach(e->{
                    Matcher matcher = pattern.matcher(e.getMobile());
                    if (matcher.matches()) { // 只有当手机号符合正则表达式时才复制数据
                        AuntUserVO vo=new AuntUserVO();
//                    vo.setAge(Integer.valueOf(e.getAge()));
                        vo.setBirthDate(e.getDateOfBirth());
                        vo.setCity(e.getCity());
                        vo.setSex(e.getSex());
                        vo.setProvince(e.getProvince());
                        vo.setDistrict(e.getDistrict());
                        vo.setName(e.getName());
                        vo.setSkill(e.getSkills());
                        vo.setIdNumber(StringUtils.isNotBlank(e.getIdNumber())?e.getIdNumber():"");
                        vo.setOrderPhone(StringUtils.isNotBlank(e.getMobile())?e.getMobile():"");
                        vo.setMaritalStatus(e.getMarriage());
                        vo.setWorkExperience(e.getWorkExperience());
                        vo.setEducation(e.getEducation());
                        vo.setIntroduction(e.getSelfEvaluation());
                        vo.setNativePlace(e.getNativePlace());
                        vo.setDetailedAddress(e.getLiveAddress());
                        vo.setResidentHome(e.getJobNatureIndex()!=null?Integer.parseInt(e.getJobNatureIndex()):-1);
                        vo.setDesireSalary(e.getExpectedSalary());
                        list.add(vo);
                    }

                });
                System.out.println(list.size());
            }
            return ApiResult.success("成功",list);
        }catch (Exception e){
            log.info(e.getMessage());
            return ApiResult.fail(e.getMessage());
        }
    }


    /** 
    * api小程序端-机构信息展示接口
    * 
    * @Description: 查看招聘公司信息;参数：机构信息id
    * @Param: [id] 
    * @return: com.jinzhi.common.utils.ApiResult<?> 
    * @Author: kl
    * @Date: 2020-04-23 
    */ 
    @GetMapping("/selCompanyInfo")
    @Log("api小程序端-机构信息展示接口")
    @ApiOperation(value = "api小程序端-机构信息展示接口", httpMethod = "GET", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @Transactional
    public ApiResult<?> selCompanyInfo(String id) {
        if(StringUtils.isBlank(id)){
            return ApiResult.lack("");//缺少参数
        }
        OrganizationNewsDO organizationNewsDO = organizationNewsService.selectById(Long.parseLong(id));
        return ApiResult.success(organizationNewsDO);
    }

    /**
     *
     * @Description: 查看所有简历
     * @Param: [token]
     * @return: com.jinzhi.common.utils.ApiResult<?>
     * @Date: 2020-04-23
     */
    @GetMapping("/recruimeList")
    @Log("查看所有简历")
    @ApiOperation(value = "查看所有简历", httpMethod = "GET", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    //@ApiImplicitParams({@ApiImplicitParam(name = TOKEN_TAG, value = TOKEN_TAG, paramType = "header")})
    public ApiResult<?> recruimeList(String experience ,String education,String arr,String name) {


        EntityWrapper<ResumesDO> wrapper = new EntityWrapper<>();
        if(!com.qiniu.util.StringUtils.isNullOrEmpty(experience)){
            wrapper.eq("work_years",experience);
        }
        if(!com.qiniu.util.StringUtils.isNullOrEmpty(education)){
            wrapper.eq("education",education);
        }
        if(!com.qiniu.util.StringUtils.isNullOrEmpty(arr)){
            wrapper.like("arr",arr);
        }

        if(!com.qiniu.util.StringUtils.isNullOrEmpty(name)){
            wrapper.like("name",name);
        }

        Page<ResumesDO>  page = resumesService.selectPage(getPage(ResumesDO.class), wrapper);
        List<ResumesDO> doList=page.getRecords();

        return ApiResult.success(doList);
    }


    /**
     *
     * @Description: 查看简历详情
     * * @Param: [token]
     * @return: com.jinzhi.common.utils.ApiResult<?>
     * @Date: 2020-04-23
     */
    @GetMapping("/recruimeDetails")
    @Log("查看所有简历")
    @ApiOperation(value = "查看所有简历", httpMethod = "GET", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    //@ApiImplicitParams({@ApiImplicitParam(name = TOKEN_TAG, value = TOKEN_TAG, paramType = "header")})
    public ApiResult<?> recruimeDetails(Long id) {
        if(id==null||id==0){
               return ApiResult.fail("非法请求");
        }
        ResumesDO  page = resumesService.selectById(id);

        if(StringUtil.notEmpty(page.getLevel())){
            page.setArr(page.getArr()+"，月嫂星级："+page.getLevel());
        }
        return ApiResult.success(page);
    }



    /**
    * api小程序端-查看我的简历接口
    *
    * @Description: 查看我的简历；参数：验证token
    * @Param: [token]
    * @return: com.jinzhi.common.utils.ApiResult<?>
    * @Author: kl
    * @Date: 2020-04-23
    */
    @GetMapping("/selResume")
    @Log("api小程序端-查看我的简历接口")
    @ApiOperation(value = "api小程序端-查看我的简历接口", httpMethod = "GET", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @Transactional
    @RequiresAuthentication
    @ApiImplicitParams({@ApiImplicitParam(name = TOKEN_TAG, value = TOKEN_TAG, paramType = "header")})
    public ApiResult<?> selResume(@RequestHeader(value = TOKEN_TAG, required = false) String token) {
        //1.根据token获取用户登录数据
        UserDO user = this.getClientUser(token);
        if (null == user) {
            return ApiResult.invalid();
        }
        ResumesDO resumesDO = resumesService.findOneByKv("user_id",user.getId());
        return ApiResult.success(resumesDO);
    }

    /**
     * api小程序端-提交和修改我的简历接口
     *
     * @Description: 提交和修改我的简历;参数：验证token，期望职业，期望月薪，籍贯，毕业院校，工作年限，教育经历，工作经验，自我评价
     * @Param: [token, desiredOccupation, expectedSalary, nativePlace, graduatedFrom, workYears, educationExperience, workExperience, selfEvaluation]
     * @return: com.jinzhi.common.utils.ApiResult<?>
     * @Author: kl
     * @Date: 2020-04-23
     */
    @RequestMapping("/updResume")
    @Log("api小程序端-提交和修改我的简历接口")
    @ApiOperation(value = "api小程序端-提交和修改我的简历接口", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @Transactional
    @RequiresAuthentication
    @ApiImplicitParams({@ApiImplicitParam(name = TOKEN_TAG, value = TOKEN_TAG, paramType = "header")})
    public ApiResult<?> updResume(@RequestHeader(value = TOKEN_TAG, required = false) String token,  ResumesDO resumesDO1) {

        //1.根据token获取用户登录数据
        UserDO user = this.getClientUser(token);
        if (null == user) {
            return ApiResult.invalid();
        }

        boolean b;
        ResumesDO resumesDO = resumesService.findOneByKv("user_id",user.getId());
        if(resumesDO != null){
            resumesDO.setWorkExperience(resumesDO1.getWorkExperience());//工作经验
            if(!com.qiniu.util.StringUtils.isNullOrEmpty(resumesDO1.getHeadPortrait())){
                resumesDO.setHeadPortrait(resumesDO1.getHeadPortrait());
            }
            resumesDO.setUserId(user.getId());
            resumesDO.setName(resumesDO1.getName());
            resumesDO.setAge(resumesDO1.getAge());
            resumesDO.setIdNumber(resumesDO1.getIdNumber());
            //resumesDO.setWorkYears(workYears);//工作年限
            resumesDO.setNativePlace(resumesDO1.getNativePlace());//籍贯
            //resumesDO.setGraduatedFrom(graduatedFrom);//毕业院校
            //resumesDO.setDesiredOccupation(desiredOccupation);//期望职业
            resumesDO.setSelfEvaluation(resumesDO1.getSelfEvaluation());//自我评价
            resumesDO.setEducationExperience(resumesDO1.getEducationExperience());//教育经历
            resumesDO.setIsPush(0);
            resumesDO.setJobNature(resumesDO1.getJobNature());
            resumesDO.setSkills(resumesDO1.getSkills());
            resumesDO.setSex(resumesDO1.getSex());
            resumesDO.setNation(resumesDO1.getNation());
            resumesDO.setEducation(resumesDO1.getEducation());
            resumesDO.setJobNatureIndex(resumesDO1.getJobNatureIndex());
            resumesDO.setLiveAddress(resumesDO1.getLiveAddress());
            resumesDO.setArr(resumesDO1.getArr());
            resumesDO.setWorkYears(resumesDO1.getWorkYears());
            resumesDO.setWorkImg(resumesDO1.getWorkImg());
            resumesDO.setMarriage(resumesDO1.getMarriage());
            resumesDO.setImglist(resumesDO1.getImglist());
            resumesDO.setProvince(resumesDO1.getProvince());
            resumesDO.setCity(resumesDO1.getCity());
            resumesDO.setDistrict(resumesDO1.getDistrict());
            resumesDO.setUpdateDate(new Date());
            resumesDO.setApplyState(resumesDO1.getApplyState());
            b = resumesService.updateById(resumesDO);
        }else{
            ResumesDO resumesDO1s = new ResumesDO();
            resumesDO1s.setUserId(user.getId());//用户id
            resumesDO1s.setWorkExperience(resumesDO1.getWorkExperience());//工作经验
            resumesDO1s.setNativePlace(resumesDO1.getNativePlace());//籍贯
           // resumesDO1.setExpectedSalary(expectedSalary);//期望月薪
            resumesDO1s.setSelfEvaluation(resumesDO1.getSelfEvaluation());//自我评价
            resumesDO1s.setEducationExperience(resumesDO1.getEducationExperience());//教育经历
            resumesDO1s.setState(0);//默认上线
            resumesDO1s.setIsPush(0);
            resumesDO1s.setWorkYears(resumesDO1.getWorkYears());
            resumesDO1s.setJobNature(resumesDO1.getJobNature());
            //resumesDO1.setApplyState(Integer.parseInt(applyState));
            resumesDO1s.setSkills(resumesDO1.getSkills());
            resumesDO1s.setSex(resumesDO1.getSex());
            resumesDO1s.setNation(resumesDO1.getNation());
            resumesDO1s.setEducation(resumesDO1.getEducation());
            resumesDO1s.setLiveAddress(resumesDO1.getLiveAddress());
            resumesDO1s.setArr(resumesDO1.getArr());
            resumesDO1s.setWorkImg(resumesDO1.getWorkImg());
            resumesDO1s.setImglist(resumesDO1.getImglist());
            resumesDO1s.setMarriage(resumesDO1.getMarriage());
            resumesDO1s.setProvince(resumesDO1.getProvince());
            resumesDO1s.setCity(resumesDO1.getCity());
            resumesDO1s.setDistrict(resumesDO1.getDistrict());
            resumesDO1s.setHeadPortrait(resumesDO1.getHeadPortrait());
            resumesDO1s.setName(resumesDO1.getName());
            resumesDO1s.setAge(resumesDO1.getAge());
            resumesDO1s.setSex(resumesDO1.getSex());
            resumesDO1s.setCreaterDate(new Date());
            resumesDO1s.setApplyState(resumesDO1.getApplyState());
            b = resumesService.insert(resumesDO1s);
        }
        if(b){
//
//            if (Integer.parseInt(isPush) == 1){
//                //匹配该用户期望职业的招聘信息
//                Wrapper<RecruitmentNewsDO> wrapper = new EntityWrapper<>();
//                wrapper.like("name" , desiredOccupation);
//                List<RecruitmentNewsDO> recNewsList = recruitmentNewsService.selectList(wrapper);
//                if (recNewsList.size() != 0){
//                    for (RecruitmentNewsDO recNews : recNewsList){
//                        //自动投递简历·
//                        ApplicationRecordDO appRecord = applicationRecordService.findOneByKv("rnews_id" , recNews.getId(), "user_id" , user.getId());
//                        if (appRecord == null){
//                            ApplicationRecordDO applicationRecord = new ApplicationRecordDO();
//                            applicationRecord.setRnewsId(recNews.getId());
//                            applicationRecord.setOrgId(recNews.getOrgId());
//                            applicationRecord.setUserId(user.getId());
//                            applicationRecord.setState(2);
//                            applicationRecord.setAppTime(new Date());
//                            applicationRecord.setCreaterDate(new Date());
//                            applicationRecordService.insert(applicationRecord);
//                        }
//                    }
//                }
//            }

            return ApiResult.success();
        }else{
            return ApiResult.fail("提交错误");
        }
    }


    /**
     * api小程序端-查看我的简历接口
     *
     * @Description: 查看我的简历；参数：验证token
     * @Param: [token]
     * @return: com.jinzhi.common.utils.ApiResult<?>
     * @Author: kl
     * @Date: 2020-04-23
     */
    @GetMapping("/selResumeUser")
    @Log("api小程序端-查看我的简历接口")
    @ApiOperation(value = "api小程序端-查看我的简历接口", httpMethod = "GET", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @Transactional
    public ApiResult<?> selResumeUser(Long id) {
        if(id==null){
            return ApiResult.fail("非法请求！");
        }
        ResumesDO resumesDO = resumesService.findOneByKv("id",id);


        return ApiResult.success(resumesDO);
    }


    /**
     * api小程序端-招聘岗位列表接口--公开方法，不需要登录
     *
     * @Description: 招聘岗位列表接口（需分页），参数：页码，显示数，岗位名称，0热门/1最新（筛选条件）
     * @Param: [current, number, name, type]
     * @return: com.jinzhi.common.utils.ApiResult<?>
     * @Author: kl
     * @Date: 2020-04-26
     */
    @GetMapping("/selJobList")
    @Log("api小程序端-招聘岗位列表接口")
    @ApiOperation(value = "api小程序端-招聘岗位列表接口", httpMethod = "GET", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @Transactional
    public ApiResult<?> selJobList(String current, String number, String name, String type) {
        if(StringUtils.isBlank(type)){
            return ApiResult.lack("");//缺少参数
        }
        //判断是否为数字
        if (!IdCardUtil.isNumeric(type)) {
            return ApiResult.format("");//格式错误
        }

        Map map = new HashMap();
        map.put("name",name);
        Page<RecruitmentNewsVo> page = recruitmentNewsService.selectListPage(Integer.parseInt(current), Integer.parseInt(number), map,type);

        return ApiResult.success(page);
    }

    /**
    * api小程序端-招聘岗位详情接口
    *
    * @Description: 获取岗位信息详情，参数：岗位id
    * @Param: [id]
    * @return: com.jinzhi.common.utils.ApiResult<?>
    * @Author: kl
    * @Date: 2020-04-26
    */
    @GetMapping("/selJobDetails")
    @Log("api小程序端-招聘岗位详情接口")
    @ApiOperation(value = "api小程序端-招聘岗位详情接口", httpMethod = "GET", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @Transactional
    public ApiResult<?> selJobDetails(String id) {
        if(StringUtils.isBlank(id)){
            return ApiResult.lack("");//缺少参数
        }
        RecruitmentNewsDO recruitmentNews = recruitmentNewsService.selectById(Long.parseLong(id));
        recruitmentNews.setBrowseNumber(recruitmentNews.getBrowseNumber() + 1);
        boolean b = recruitmentNewsService.updateById(recruitmentNews);
        if(b){
            RecruitmentNewsDO recruitmentNewsDO = recruitmentNewsService.selJobDetails(Long.parseLong(id));
            return ApiResult.success(recruitmentNewsDO);
        }else{
            return ApiResult.fail("信息错误，请重试");
        }


    }

    /** 
    * api小程序端-个人中心-控制简历上线下线接口
    * 
    * @Description: 根据简历id，控制自己简历上线下线；参数：简历id，状态（0上线，1下线）
    * @Param: [token, id, state] 
    * @return: com.jinzhi.common.utils.ApiResult<?> 
    * @Author: kl
    * @Date: 2020-04-27 
    */ 
    @GetMapping("/updChangeState")
    @Log("api小程序端-个人中心-控制简历上线下线接口")
    @ApiOperation(value = "api小程序端-个人中心-控制简历上线下线接口", httpMethod = "GET", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @Transactional
    @RequiresAuthentication
    @ApiImplicitParams({@ApiImplicitParam(name = TOKEN_TAG, value = TOKEN_TAG, paramType = "header")})
    public ApiResult<?> updChangeState(@RequestHeader(value = TOKEN_TAG, required = false) String token,String id,String state) {
        //1.根据token获取用户登录数据
        UserDO user = this.getClientUser(token);
        if (null == user) {
            return ApiResult.invalid();
        }
        if(StringUtils.isBlank(id)){
            return ApiResult.lack("");//缺少参数
        }
        if(StringUtils.isBlank(state)){
            return ApiResult.lack("");//缺少参数
        }
        //判断是否为数字
        if (!IdCardUtil.isNumeric(state)) {
            return ApiResult.format("");//格式错误
        }

        ResumesDO resumesDO = resumesService.selectById(Long.parseLong(id));
        if(state.equals("0")){
            resumesDO.setState(0);
        }else{
            resumesDO.setState(1);
        }
        boolean b = resumesService.updateById(resumesDO);
        if(b){
            return ApiResult.success("更改成功");
        }else{
            return ApiResult.fail("更改失败");
        }
    }

    /** 
    * api小程序端-投递简历接口
    * 
    * @Description: 用户投递简历；参数：验证token，招聘岗位id
    * @Param: [token, id] 
    * @return: com.jinzhi.common.utils.ApiResult<?> 
    * @Author: kl
    * @Date: 2020-04-27 
    */ 
    @PostMapping("/addResume")
    @Log("api小程序端-投递简历接口")
    @ApiOperation(value = "api小程序端-投递简历接口", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @Transactional
    @RequiresAuthentication
    @ApiImplicitParams({@ApiImplicitParam(name = TOKEN_TAG, value = TOKEN_TAG, paramType = "header")})
    public ApiResult<?> addResume(@RequestHeader(value = TOKEN_TAG, required = false) String token,String id) {
        //1.根据token获取用户登录数据
        UserDO user = this.getClientUser(token);
        if (null == user) {
            return ApiResult.invalid();
        }
        if(StringUtils.isBlank(id)){
            return ApiResult.lack("");//缺少参数
        }

        ResumesDO resumesDO = resumesService.findOneByKv("user_id",user.getId());
        if(resumesDO != null){
            RecruitmentNewsDO recruitmentNewsDO = recruitmentNewsService.selectById(Long.parseLong(id));
            if(recruitmentNewsDO != null){
                ApplicationRecordDO applicationRecordDO = applicationRecordService.findOneByKv("user_id",user.getId(),"rnews_id",Long.parseLong(id));
                if(applicationRecordDO == null){
                    ApplicationRecordDO applicationRecordDO1 = new ApplicationRecordDO();
                    applicationRecordDO1.setUserId(user.getId());//用户id
                    applicationRecordDO1.setOrgId(recruitmentNewsDO.getOrgId());//机构id
                    applicationRecordDO1.setRnewsId(Long.parseLong(id));//招聘岗位id
                    applicationRecordDO1.setAppTime(new Date());//应聘时间
                    applicationRecordDO1.setCreaterDate(new Date());//创建时间
                    applicationRecordDO1.setState(2);//默认沟通中
                    boolean b = applicationRecordService.insert(applicationRecordDO1);
                    if(b){
                        recruitmentNewsDO.setAppNumber(recruitmentNewsDO.getAppNumber() + 1);
                        recruitmentNewsService.updateById(recruitmentNewsDO);

                        return ApiResult.success("投递成功，请静候佳音！");
                    }else{
                        return ApiResult.fail("投递失败，请刷新重试！");
                    }
                }else{
                    return ApiResult.fail("您已投递，请勿重复！");
                }
            }else{
                return ApiResult.fail("信息错误，请刷新重试！");
            }
        }else{
            return ApiResult.build(ApiEnumError.NORESUMES.getCode(), ApiEnumError.NORESUMES.getMsg());
        }
    }

    /** 
    * api小程序端-简历投递记录列表接口
    * 
    * @Description: 获取当前用户的简历投递记录列表信息；参数：验证token，页码，显示数，状态（0成功，1失败，2沟通中）（筛选条件) 
    * @Param: [token, current, number, state] 
    * @return: com.jinzhi.common.utils.ApiResult<?> 
    * @Author: kl
    * @Date: 2020-04-27 
    */ 
    @GetMapping("/selApplicationRecord")
    @Log("api小程序端-简历投递记录列表接口")
    @ApiOperation(value = "api小程序端-简历投递记录列表接口", httpMethod = "GET", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @Transactional
    @RequiresAuthentication
    @ApiImplicitParams({@ApiImplicitParam(name = TOKEN_TAG, value = TOKEN_TAG, paramType = "header")})
    public ApiResult<?> selApplicationRecord(@RequestHeader(value = TOKEN_TAG, required = false) String token,String current, String number,String state) {
        //1.根据token获取用户登录数据
        UserDO user = this.getClientUser(token);
        if (null == user) {
            return ApiResult.invalid();
        }
        if(StringUtils.isBlank(state)){
            return ApiResult.lack("");//缺少参数
        }
        //判断是否为数字
        if (!IdCardUtil.isNumeric(state)) {
            return ApiResult.format("");//格式错误
        }

        Map map = new HashMap();
        map.put("userId",user.getId());
        map.put("state",state);
        Page<ApplicationRecordVo> page = applicationRecordService.selectListPage(Integer.parseInt(current), Integer.parseInt(number), map);

        return ApiResult.success(page);
    }
}
